﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GifAnimator"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="using:Callisto.Controls"
    x:Class="GifAnimator.MainPage"
    mc:Ignorable="d">
    <Page.Resources>
        <DataTemplate x:Key="DataTemplateImage">
            <StackPanel Orientation="Vertical">
                <Image Source="{Binding Image}" Width="75" Height="75" Stretch="UniformToFill"/>
                <TextBlock Text="{Binding Duration}" FontSize="15"/>
            </StackPanel>
        </DataTemplate>
    </Page.Resources>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <ListView x:Name="ListImage" Height="224" Margin="0,544,0,0" VerticalAlignment="Bottom" Width="1366" SelectionMode="Multiple"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Disabled"
                ScrollViewer.HorizontalScrollMode="Enabled"
                ScrollViewer.VerticalScrollMode="Disabled"
                ScrollViewer.ZoomMode="Disabled"
                ItemTemplate="{StaticResource DataTemplateImage}" Background="#FF824AE4">
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
        </ListView>

        <StackPanel HorizontalAlignment="Left" Height="400" Margin="314,74,0,0" VerticalAlignment="Top" Width="400">

            <Canvas Background="Gray" Margin="100,0,10,0">
                <CaptureElement x:Name="previewCanvas" Height="210" Canvas.Left="10" Canvas.Top="132" Width="270" RenderTransformOrigin="0.6,-0.84"/>
                <Button x:Name="btnPhoto" Content="Photo" Canvas.Left="152" Canvas.Top="10" Click="ButtonPhoto_Click" Width="128"/>
                <Button x:Name="btnStart" Content="Start" Canvas.Left="10" Canvas.Top="10" Click="ButtonStartPreview_Click"/>
                <Button x:Name="btnStop" Content="Stop" Canvas.Left="11" Canvas.Top="48" Click="ButtonStopPreview_Click"/>
                <Button x:Name="btnGif" Content="Générer GIF" Canvas.Left="152" Canvas.Top="48" Click="btnGif_Click" RenderTransformOrigin="0.531,0.908" Width="128" />
                <Button x:Name="btnRead" Content="Read" Canvas.Left="79" Canvas.Top="10" RenderTransformOrigin="0.971,0.789" Click="btnRead_Click" />
                <Button x:Name="btnWrite" Content="Write" Canvas.Left="79" Canvas.Top="48" Click="btnWrite_Click" />
                <Button x:Name="btnLoadImage" Content="Load image" Canvas.Left="11" Canvas.Top="94" Click="BtnLoadImage_Click" Width="136"/>
            </Canvas>
        </StackPanel>

        <TextBox x:Name="nbPhoto" HorizontalAlignment="Left" Margin="625,170,0,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
        <Image x:Name="imageLast" HorizontalAlignment="Left" Height="210" Margin="424,207,0,0" VerticalAlignment="Top" Width="270" Opacity="0.5"/>
        <Image x:Name="ImagePreview" HorizontalAlignment="Left" Height="163" Margin="996,114,0,0" VerticalAlignment="Top" Width="163"/>
        <Slider HorizontalAlignment="Left" Margin="467,474,0,0" VerticalAlignment="Top" Width="222" Value="75" ValueChanged="Slider_ValueChanged"/>

    </Grid>
</Page>
